package com.yuexi.web;

import com.yuexi.table.api.TableService;
import com.yuexi.table.dto.TableDTO;
import com.zenx.dto.SingleResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author jie
 * @date 2023/4/5 -18:50
 */
@Api(tags = "桌台")
@RequestMapping("/table")
@RestController
public class TableController {

    @Autowired
    private TableService service;

    @ApiOperation("列表")
    @PostMapping("/list")
    public SingleResponse<Map<String, List<TableDTO>>> list() {
        return SingleResponse.success(service.list());
    }
}
